;; =============================================================================
;; loads and runs all the tests related to oali.core component

;; load assumes we're in $OALI/src directory
(load "core/oali-core.asd")

;; load all the stuff
(asdf:operate 'asdf:load-op 'oali.core)

;; tests entry point
(defun ut-oali-core-parser-run-tests ()
  ;; create context and parse certain declarations
  (let ((ctx (oali.core:create-context)))
    (oali.core:parse ctx "((test dump-type uint))"))
  
  t)

;; run all the tests
(ut-oali-core-parser-run-tests)

(defparameter *ut-sample-program-1*
  "(

(test dump-type-uint)

)")

(defparameter *ut-sample-program-2*
  "(
(test dump-type uint)

(type unsigned long temperature)
(test dump-type temperature)

(test undefine-type temperature)

(test dump-all-types)

(test type-defined uint)
(test type-undefined unit-type)

(type unsigned long unit-type)
(test type-defined unit-type)
(test undefine-type unit-type)
(test type-undefined unit-type)

(type unk-unit-type)
(test type-defined unk-unit-type)
;; (test dump-type unk-unit-type)
(test dump-all-types)
(test undefine-type unk-unit-type)
(test type-undefined unk-unit-type)

(constraint (is temperature pointer))

(test print \"Whoa, this is a diagnostic message\")

(type key)

(test dump-type key)
)")

(defparameter *ut-sample-program-3*
  "(

(func foo (a b c) (return 0))

;; more complex declaration
(func foo (a b c)
      (progn
	(return 0)))

)")

#|
(oali.core:parse nil "((type Temperature))")
|#

